package com.bye.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.bye.dto.CustomerDto;
import com.bye.dto.ProductCategoryDto;
import com.bye.dto.ProductInfoDto;
import com.bye.mapper.ProductMapper;
import com.bye.service.ProductCategoryService;
import com.bye.service.ProductService;
import com.bye.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/product")
public class ProductInfoController {
    @Autowired
    private ProductService productService;

    @RequestMapping("/accountProduct")
    public Result accountProduct(){
        String string = productService.accountProduct();
        return Result.success(string);
    }
    @RequestMapping("/productsOfConsume")
    public Result selectProductsOfConsume(){
        List<ProductInfoDto> list = productService.selectProductsOfConsume();
        return Result.success().put("list", list);
    }


}
